﻿<%@ Page Title="" Language="C#" MasterPageFile="~/App_MasterPages/Aquarius.Master" AutoEventWireup="true" CodeBehind="SysAssignRightsPage.aspx.cs" Inherits="SMSROUTER.UI.SysAssignRightsPage" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ScriptContent" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            RegisterDialog();
        });

        function UserCheckAll(obj) {
            $(":checkbox", $("[id$=grvUser]")).prop("checked", obj.checked);
        }
    </script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="MainContent" runat="server">
    <asp:DropDownList ID="ddlSysGroup" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlSysGroup_SelectedIndexChanged"></asp:DropDownList>
    <%--Phân cho nhóm được phép truy cập những menu nào--%>
    <div class="head">
        <!-- Tiêu đề của bảng (Thẻ div này chứa nút refresh) -->
        <div class="isw-grid"></div>
        <h1>Phân quyền trên các trang</h1>
        <ul class="buttons">
            <li>
                <asp:LinkButton CssClass="isw-ok" ID="lbtSave2" runat="server" OnClick="lbtSave2_Click" ToolTip="Lưu"></asp:LinkButton>
            </li>
            <li>
                <asp:LinkButton CssClass="isw-refresh" ID="lbtRefresh2" runat="server" OnClick="lbtRefresh2_Click" ToolTip="Refresh"></asp:LinkButton>
            </li>
        </ul>
        <div class="clear"></div>
    </div>

    <div class="block-fluid table-sorting">
        <asp:GridView ID="grvRights" class="dataTables_wrapper table dataTable" runat="server" CssClass="table" AutoGenerateColumns="false">
            <Columns>
                <asp:TemplateField HeaderText="Trang" ItemStyle-CssClass="Text">
                    <ItemTemplate>
                        <%# Eval("MenuName").ToString().ShowNameLevel(Eval("Level").ToString()) %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Read" ItemStyle-CssClass="CheckBox">
                    <ItemTemplate>
                        <asp:CheckBox ID="chkChecked1" Checked='<%#Eval("Role1") %>' runat="server" />
                        <asp:HiddenField ID="hdfMenuID" Value='<%#Eval("MenuID") %>' runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Write" ItemStyle-CssClass="CheckBox">
                    <ItemTemplate>
                        <asp:CheckBox ID="chkChecked2" Checked='<%#Eval("Role2") %>' runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
</asp:Content>
